﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Microsoft.Tools.CodeRunner.Tasks
{
    internal class ConfigBuilder
    {
        private StringBuilder sb = new StringBuilder();
        private int count = 0;

        public void AppendIfNotNull(string name, bool? flag)
        {
            if (flag != null)
            {
                sb.AppendFormat("{0}={1};", name, flag.ToString());
                count++;
            }
        }

        public int Count { get { return count; } }

        public override string ToString()
        {
            return sb.ToString();
        }
    }

}
